<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2023/11/17
  Time: 21:00
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>


<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>pagehome</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <style>
        body{
            background: #F2F5F7;
            display: flex;
            flex-direction: column;
            background-size: cover;
            background-repeat: no-repeat;
        }
        img{
            width: 70px;
            height: 70px;
            border-radius: 50%;
        }
        .r1{
            flex-direction:column;
            flex-wrap: nowrap;

        }
        .page-header{
            color: #1a1a1a;
            font-weight: bold;
            flex-direction: row;
            justify-content: end;
        }
        .admin{
            color: blanchedalmond;
            animation-name: admin;
            animation-duration: 3s;
            animation-iteration-count: infinite;
            animation-delay: 10ms;

        }
        @keyframes admin {
            from{
                color:beige;
            }
            10%{
                color: brown;

            }
            50%{
                color: rgb(157, 19, 19);

            }
            80%{
                color: rgb(55, 73, 210);

            }90%{
                 color: rgb(22, 3, 3);

             }
            to{
                color: blue;
            }
        }
        #search{
            width: 100%;
        }
        #searchbox{
            width: 100%;
        }
        table{
            color: #4A235A;
            text-align: center;

        }
        #btn{
            width: 100%;

        }
        #btn:hover{
            background: #D1E8E2 ;
            color: white;
        }
        #motai{
            display: flex;
            flex-direction: column;
        }
        #infomation{
            width: 100%;
        }
        .r5{
            width: 100%;
            display: flex;
            flex-direction: column;
        }
        .r5 button{
            width: 100%;
        }

    </style>
</head>
<body>
<div class="r1">
    <div class="page-header">
        <h1>学生宿舍管理系统<small>欢迎您尊贵的<small class="admin">
            <%=

            request.getSession().getAttribute("user")
            %>

        </small> </small>   </h1>

    </div>

</div>
<div class="r2 container">

    <ul class="nav nav-pills">
        <li role="presentation" class="active"><a href="#">宿舍信息查询</a></li>
        <li role="presentation"  class="active ">  <a id="btn" data-toggle="modal" data-target="#myModal1">
            新增宿舍信息
        </a> </li>

    </ul>
</div>




</div>
<div class="r4 container">

    <table class="table table-bordered">

        <thead>
        <tr>
            <th>宿舍号</th>
            <th>价格</th>
            <th>床位</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>

        <c:forEach items="${requestScope.list}" var="stu" >

            <tr>

                <td>${stu.homeid}</td>
                <td>${stu.price}</td>
                <td>${stu.bedid}</td>

                    <%--                <td>--%>
                    <%--                    <button class="btn btn-primary " id="btn" data-toggle="modal" data-target="#myModal">--%>
                    <%--                        编辑--%>
                    <%--                    </button>--%>
                    <%--                </td>--%>

                <td>无</td>
            </tr>
        </c:forEach>




        </tbody>

    </table>
    <div  class="r5">
        <span id="infomation" class="alert alert-danger" role="alert">如果查询不到 请检查您的学号是否输入正确</span>
        <button onclick="goback()" class="btn btn-primary">返回</button>
    </div>
</div>
<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    新增宿舍信息
                </h4>
            </div>
            <div class="modal-body">
                <!--新增表单-->
                <div id="motai">
                    <form action="homein" method="post">
                        <input type="text" id="btn" name="homeid" value="" placeholder="宿舍楼号 例如1栋">
                        <input type="text" id="btn" name="price" placeholder="价格 例如100(元/年)">
                        <input type="text" id="btn" name="bedid" placeholder="床位">


                </div>
                <div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-default"  data-dismiss="modal">关闭
                        </button>
                        <button type="submit"  class="btn btn-primary">
                            新增
                        </button>
                        </form>
                    </div>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>

</div>
<script>
function  goback(){
    history.back(-1)
}
</script>
</body>
</html>

